import React from 'react'
import { Navigate } from 'react-router-dom'
function Hook(Com) {
    return (() => {
        const token = localStorage.getItem('token')
        if (token) {
            return <Com></Com>
        } else {
            return <Navigate to='/login'></Navigate>
        }
    })
}
export default Hook
